CSC_FLAGS = -debug -nowarn:0169

ASSEMBLY_NAME = wnck-sharp
ASSEMBLY = $(ASSEMBLY_NAME).dll
ASSEMBLY_CONFIG = $(ASSEMBLY).config

API_SOURCE = wnck-api.raw

wnckdir = $(pkglibdir)
wnck_SCRIPTS = $(ASSEMBLY) $(ASSEMBLY).mdb
wnck_DATA = $(ASSEMBLY_CONFIG)

ASSEMBLY_REFERENCES = \
	$(GTKSHARP_LIBS)

all: $(ASSEMBLY)

$(ASSEMBLY): generated-stamp
	$(CSC) $(CSC_FLAGS) -target:library -out:$@ $(ASSEMBLY_REFERENCES) generated/*.cs

generated-stamp: $(API_SOURCE)
	$(GAPI_CODEGEN) --generate $(srcdir)/$(API_SOURCE) --outdir=$(srcdir)/generated $(GTKSHARP_CFLAGS) --assembly-name=$(ASSEMBLY_NAME) && touch generated-stamp


EXTRA_DIST = $(API_SOURCE) $(ASSEMBLY_CONFIG)

CLEANFILES = $(ASSEMBLY) *.dll *.exe generated/*.cs generated-stamp
DISTCLEANFILES = *.mdb
MAINTAINERCLEANFILES = Makefile.in
